<script>
	import Vue from 'vue'
	import {queryLocalUrl} from '@/api/api.js' 
	export default {
		onLaunch: function() {
			//查询对应的本地访问路径
			queryLocalUrl().then(res=>{
				console.log(res.data);
				this.$store.commit("LOCAL_URL",res.data)
			})
			uni.getSystemInfo({
				success: function(e) {
					// #ifndef MP
					Vue.prototype.StatusBar = e.statusBarHeight;
					if (e.platform == 'android') {
						Vue.prototype.CustomBar = e.statusBarHeight + 50;
						Vue.prototype.WindowHeight = document.documentElement.clientHeight - (e.statusBarHeight*2 + 50*2)
					} else {
						Vue.prototype.CustomBar = e.statusBarHeight + 45;
						Vue.prototype.WindowHeight = document.documentElement.clientHeight - (e.statusBarHeight*2 + 45*2) 
					};
					// #endif

					// #ifdef MP-WEIXIN
					Vue.prototype.StatusBar = e.statusBarHeight;
					let custom = wx.getMenuButtonBoundingClientRect();
					Vue.prototype.Custom = custom;
					Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
					wx.getSystemInfo({
						success:function(res){
								console.log("动态获取屏幕高度",res.windowHeight)
								Vue.prototype.WindowHeight = res.windowHeight - (custom.bottom + custom.top)
						}
					})
					// #endif		

					// #ifdef MP-ALIPAY
					Vue.prototype.StatusBar = e.statusBarHeight;
					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
					// #endif
				},
			})
			uni.getLocation({
				 type: 'wgs84',
				 success: function (res) {
					 console.log('当前位置的经度：' + res.longitude);
					 console.log('当前位置的纬度：' + res.latitude);
					 Vue.prototype.longitude = res.longitude;
					 Vue.prototype.latitude = res.latitude;
				 }
			 });
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "@/uni_modules/uview-ui/index.scss";
	@import url("@/plugin/animate/animate.min.css");
	@import 'static/css/base.css';
	// @import 'static/css/guildford.css';
	@import 'static/css/style.scss';

	/* 条件编译，仅在H5平台生效 */
	// #ifdef H5
	body::-webkit-scrollbar,
	html::-webkit-scrollbar {
		display: none;
	}
	// #endif
	view {
		box-sizing: border-box;
	}

	.bg-color-red {
		background-color: #E93323 !important;
	}

	.syspadding {
		padding-top: var(--status-bar-height);
	}

	.flex {
		display: flex;
	}
	.u-flex {
		display: flex;
	}
	

	.uni-scroll-view::-webkit-scrollbar {
		/* 隐藏滚动条，但依旧具备可以滚动的功能 */
		display: none
	}

	::-webkit-scrollbar {
		width: 0;
		height: 0;
		color: transparent;
	}
</style>

